package com.nercel.dsj.gksales.service;

import java.util.List;
import java.util.Map;

import com.nercel.dsj.gksales.model.ListResult;
import com.nercel.dsj.gksales.model.QueryParams;
import com.nercel.dsj.gksales.model.dto.SalesRecordResultDTO;
import com.nercel.dsj.gksales.model.entity.Payment;
import com.nercel.dsj.gksales.model.entity.SellRecord;

/**
 * @author sunlin
 * @date 2019-4-23
 */
public interface SellRecordService extends DaoBaseService<SellRecord, Integer> {

    ListResult<SalesRecordResultDTO> listWithPaging(QueryParams queryParams);

    List<Map<String, Object>> salesRecordsStatistics(QueryParams queryParams);

    List<SalesRecordResultDTO> list(QueryParams queryParams);

    /**
     * 保存销售信息并给用户激活码
     * 
     * @param salesUserId
     *            当前登陆用户，即销售人员
     */
    void saveAndActivate(SellRecord sellRecord, Integer salesUserId);

    /**
     * 根据支付信息创建激活用户
     */
    void saveAndActivateWithPayment(Payment payment);

    /**
     * 保存销售信息并给用户激活码
     * 
     * @param userId
     *            当前登陆用户，即销售人员
     */
    void saveAndActivateBatch(List<SellRecord> params, Integer userId);

}
